<extend name="Public/base" />
<block name="content">
<div id="content">
	<div id="content-header">
		<div id="breadcrumb">
			<a class="tip-bottom" href="{:U('Index/index')}" data-original-title="首页"><i class="icon-home"></i> 首页</a>
			<a class="tip-bottom" href="{:U('Article/tags')}" data-original-title="">{$meta_title_c}</a>
			<a class="current" href="{$post_url}">{$meta_title}</a>
		</div>
	</div>
	<div class="container-fluid">
		<br/>
		<div class="row-fluid">
			<div class="span12">
				<div class="widget-box">
					<div class="widget-title">
						<span class="icon"> <i class="icon-align-justify"></i></span>
						<h5>{$meta_title}</h5>
					</div>
					<div class="widget-content nopadding">
						<form class="form-horizontal" method="post" action="">
							<div class="control-group">
								<label class="control-label"><font color="red">*</font>一级分类:</label>
								<div class="controls">
									<select style="width: 225px;" placeholder='请选择' name="ask_category_pid" id="ask_category_pid" onchange="change_ask_category(this.value,'{:U('ServiceApi/getAskCategory')}')">
							            <option value=0>请选择一级分类</option>
							            <notempty name="category_list">
								            <volist name='category_list' id='vo'>
								           		<option value="{$vo.ask_category_id}" name='ask_category_id'>{$vo.ask_category_name|htmlspecialchars}</option>  
								            </volist>
							            </notempty>
							        </select>
								</div>
							</div>
							<div class="control-group">
								<label class="control-label"><font color="red">*</font>二级分类:</label>
								<div class="controls">
									<select style="width: 225px;" multiple="multiple" name="ask_category_id[]" id="ask_category_id">
										<notempty name="two_category_list">
								            <volist name='two_category_list' id='vo'>
								           		<option value="{$vo.ask_category_id}" >{$vo.ask_category_name|htmlspecialchars}</option>  
								            </volist>
							            </notempty>
									</select>
	        					</div>
							</div>
							
							<div class="control-group">
								<label class="control-label"><font color="red">*</font>标签名称:</label>
								<div class="controls">
									<input type="text"  maxlength="10"  placeholder="标签名称1-10个字符" class="ui-wizard-content span3" name="ask_tags_name" value="{$info.ask_tags_name|htmlspecialchars}" >
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">标题名称:</label>
								<div class="controls">
									<textarea type="text"  maxlength="50"  placeholder="标题名称1-50个字符" class="ui-wizard-content span3" name="ask_tags_title" >{$info.ask_tags_title|htmlspecialchars}</textarea>
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">关键字名称:</label>
								<div class="controls">
									<textarea type="text"  maxlength="50"  placeholder="关键字名称1-50个字符" class="ui-wizard-content span3" name="ask_tags_keyword" >{$info.ask_tags_keyword|htmlspecialchars}</textarea>
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">描述:</label>
								<div class="controls">
									<textarea type="text"  maxlength="100"  placeholder="描述1-100个字符" class="ui-wizard-content span3" name="ask_tags_description"  >{$info.ask_tags_description|htmlspecialchars}</textarea>
								</div>
							</div>
							<div class="control-group">
								<label class="control-label" style="padding-bottom:10px">位置:</label>
								<div class="controls">
									<volist name=":C('ASK_TAGS_POSITION')" id="vo">
										<label class="checkbox inline fl" style=" margin-left:0px">
											<input style="width:15px; height:15px;" type="checkbox" name="position[]" value="{$key}"  <if condition="checkShopPosition($key,$info['position'])">checked="checked"</if> />{$vo}
										</label>
									</volist>
								</div>
							</div>
							<div class="form-actions">
								<button class="btn btn-success" type="submit">提交</button>
								<button type="button" class="btn btn-danger" onclick="javascript:history.back(-1);return false;">返 回</button>
							</div>
							<input type="hidden" name="ask_tags_id" value="{$info.ask_tags_id}"/>
						</form>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<script src="__JS__/jjhh.js?v={:C('TKE_VERSION')}"></script>
<script type="text/javascript">
$(document).ready(function(){
	set_value("ask_category_pid",'{$info.ask_category_pid|default=0}');
	set_value("ask_category_id[]",'{$info.ask_category_id|default=0}');
	//初始化登录用户名输入焦点
	tke_form_focus();
	$("form").submit(function(){
		//锁定登录按钮
		$('button').attr('disabled',true);
		var self = $(this);
		$.post("{$post_url}", self.serialize(), call_back, "json");
		return false;
		
		/**
		* @todo 接收登录返回值
		* @author PHP@妖孽 <dino_ma@163.com>
		*/
		function call_back(data){
			if(data.status==1){
				tke_alert(data.info,'alert-success');
				setTimeout(function(){
				if (data.url) {
						location.href=data.url;
					}else{
						location.reload();
					}
				},1500);
			} else {
				$('button').attr('disabled',false);
				tke_alert(data.info,'alert-error');
			}
		}
	});
	//导航高亮
	highlight_subnav("{:U('Article/tags')}");
	
});

</script>
</block>